<div id="products">
<?php
	$sql_cat = "SELECT * FROM category";
	$result_cat = mysql_query($sql_cat, $conn) or die(mysql_error());
	
	while ($row_cat = mysql_fetch_assoc($result_cat)) {
		$cat_id = $row_cat['CatID'];
		$cat_name = $row_cat['CatName'];
		echo "&nbsp;&nbsp;&nbsp;&nbsp;<a name='$cat_id'><b>$cat_name</b></a><br/>";
		
		$sql_prod = "SELECT * FROM product WHERE CatID='$cat_id'";
		$result_prod = mysql_query($sql_prod, $conn) or die(mysql_error());
		
		while ($row_prod = mysql_fetch_assoc($result_prod)) {
			$prod_id = $row_prod['ProdID'];
			$prod_name = $row_prod['Name'];
			$prod_img_path = $row_prod['Image_path'];
			$prod_short_desc = $row_prod['ClickDesc'];
			echo "<div class='product'>";
			echo "<div style='padding-top: 5px; padding-left:5px'>&nbsp;<b>$prod_name</b></div>";
			echo 	"<div class='product_img'><img src='/etronix/images/$prod_img_path' /></div>";
			echo 	"<div class='product_desc'>";
			echo 	$prod_short_desc . "<br/><a href='/etronix/detail.php?cid=$cat_id#$prod_id'>Details >></a>";
			echo	"</div>";
			echo "</div>";
		}
		
		echo "<div class='anchor'>";
		echo "<br />";
		echo "<a href='#top'>Top</a><a style='float: right' href='#bottom'>Bottom</a>";
		echo "<br /><br />";
		echo "</div>";
	}
?>
</div>